Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Working With Sequence Grabber Characteristics

The characteristics that govern a sequence grabber operation fall into two main categories: those that apply to the sequence grabber component, and those that apply to an individual channel that has been created for the sequence grabber. Sequence grabber components provide a number of functions in each category. This section describes the functions that allow you to configure the characteristics of the sequence grabber component. See "Working With Channel Characteristics," for information about functions that apply to a single channel.

Use the SGSetMaximumRecordTime function to limit the duration of a record operation. You can retrieve this time limit by calling the SGGetMaximumRecordTime function.

The SGSetFlags function allows you to set control flags that govern an operation. Use the SGGetFlags function to retrieve those flags.

You can obtain information about the progress of a record operation by calling the SGGetStorageSpaceRemaining and SGGetTimeRemaining functions.

You can retrieve a reference to the time base used by a sequence grabber component by calling the SGGetTimeBase function.

SGSetMaximumRecordTime

You can limit the duration of a record operation by calling the SGSetMaximumRecordTime function. You specify the time limit as an exact number of Macintosh system ticks (each is approximately a sixtieth of a second). The most efficient technique for monitoring this time limit is to examine the result code from the SGIdle function, which is described on SGIdle . When the time limit expires, the sequence grabber component sets that result code to grabTimeComplete .

pascal ComponentResult SGSetMaximumRecordTime (SeqGrabComponent s,
                                          unsigned long ticks);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
ticks
Specifies the maximum duration for the record operation, in system ticks. Set this parameter to 0 to remove the time limit from the operation.

DESCRIPTION

By default, there is no time limit on a record operation. If you do not set a limit, a record operation will run until it exhausts the Operating System resources or you call the SGStop function (described on SGStop ). Memory and disk space are the two major limiting factors.

You must call the SGSetMaximumRecordTime function before you start the record operation.

SGGetMaximumRecordTime

The SGGetMaximumRecordTime function allows you to determine the time limit you have set for a record operation.

pascal ComponentResult SGGetMaximumRecordTime (SeqGrabComponent s,
                                          unsigned long *ticks);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
ticks
Contains a pointer to a long integer that is to receive a value indicating the maximum duration for the record operation, in system ticks. A value of 0 indicates that there is no time limit.

SEE ALSO

You set this time limit by calling the SGSetMaximumRecordTime function, which is described in the previous section.

SGGetStorageSpaceRemaining

The SGGetStorageSpaceRemaining function allows you to monitor the amount of space remaining for use during a record operation. You can use this function to monitor the space being used so that you can limit the amount of space consumed by an operation. Alternatively, you can use the information you receive from this function to update a status display for the user.

pascal ComponentResult SGGetStorageSpaceRemaining
                                          (SeqGrabComponent s,
                                          unsigned long *bytes);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
bytes
Contains a pointer to a long integer that is to receive a value indicating the amount of space remaining for the current record operation. If you are recording to memory, this value contains information about the amount of memory remaining. If you are recording to a movie file, this value contains information about the amount of storage space available on the device that holds the file.

DESCRIPTION

The SGGetStorageSpaceRemaining function returns information that is appropriate for the output conditions you establish with the SGSetDataOutput function, which is described on SGSetDataOutput . If you are recording to memory, this function returns information about the amount of memory remaining. If you are recording to a movie file, this function returns information about the amount of storage space available on the device that holds the file.

You can call this function only after you have started a record operation.

RESULT CODE

seqGrabInfoNotAvailable

-9407

Sequence grabber does not have this information at this time

SGGetTimeRemaining

The SGGetTimeRemaining function allows you to obtain an estimate of the amount of recording time that remains for the current record operation. The sequence grabber component estimates this value based on the amount of storage remaining and the speed with which the record operation is consuming that space. This estimate improves as the record process continues. If you have limited the record time by calling the SGSetMaximumRecordTime function (see SGSetMaximumRecordTime for details), SGGetTimeRemaining does not return a value that is greater than the limit you have set.

pascal ComponentResult SGGetTimeRemaining (SeqGrabComponent s,
                                          long *ticksLeft);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
ticksLeft
Contains a pointer to a long integer that is to receive a value indicating an estimate of the amount of time remaining for the current record operation. This value is expressed in system ticks.

DESCRIPTION

You can call the SGGetTimeRemaining function only after you have started a record operation.

SPECIAL CONSIDERATIONS

This function may take a relatively long time to execute. You should not call it too frequently--once per second is reasonable.

RESULT CODE

seqGrabInfoNotAvailable

-9407

Sequence grabber cannot support request

SGGetTimeBase

The SGGetTimeBase function allows you to retrieve a reference to the time base that is being used by a sequence grabber component.

pascal ComponentResult SGGetTimeBase (SeqGrabComponent s,
                                         TimeBase *tb);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager OpenDefaultComponent or OpenComponent function.
tb
Contains a pointer to a time base record that is to receive information about the sequence grabber's time base.

DESCRIPTION

You can examine the time base to monitor an operation or to schedule events based on time values. However, you should not change this time base in any way.

SGSetFlags

The SGSetFlags function allows you to pass control information about the current operation to the sequence grabber component.

pascal ComponentResult SGSetFlags (SeqGrabComponent s,
                                         long sgFlags);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
sgFlags
Contains flags for the current operation. The following flag is defined (set unused flags to 0):
sgFlagControlledGrab
Informs the sequence grabber component that you are working with a frame-addressable device to perform a controlled record operation. The sequence grabber and its channel components optimize their operation for this situation. This flag allows the sequence grabber component to trade off speed and quality. Set this flag to 1 if you are performing a controlled grab using a frame-addressable source device.

SGGetFlags

You can retrieve a sequence grabber's control flags by calling the SGGetFlags function.

pascal ComponentResult SGGetFlags (SeqGrabComponent s,
                                         long *sgFlags) ;
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
sgFlags
Contains a pointer to a long integer that is to receive the control flags for the current operation. The following flag is defined (unused flags are set to 0):
sgFlagControlledGrab
Informs the sequence grabber component that you are working with a frame-addressable device to perform a controlled record operation. The sequence grabber and its channel components optimize their operation for this situation. This flag allows the sequence grabber component to trade off speed and quality. This flag is set to 1 if you are performing a controlled grab using a frame-addressable source device.

SEE ALSO

You set these flags by calling the SGSetFlags function, which is described in the previous section.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next